package com.itc.bpm.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itc.bpm.bean.BpmProcessInstanceExt;
import com.itc.bpm.dto.BpmFactoryCountDto;
import com.itc.bpm.vo.BpmProcessUpVo;
import com.itc.common.core.domain.R;

import java.util.List;

public interface BpmProcessInstanceExtService extends IService<BpmProcessInstanceExt> {
    void updateStatus(String processInstanceId, Integer status);

    /**
     *
     * @param processInstaneId
     * @return
     */
    BpmProcessInstanceExt getProcessInstanceExtByInstanceId(String processInstaneId);

    Boolean checkServiceIsExists(String businessKey,String modelId);

    /**
     *
     * @return
     */
    R<List<BpmFactoryCountDto>> countProcessInstanceInfo();

    /**
     * 升降级
     * @param bpmFormDesign
     * @return
     */
    R upDwon(BpmProcessUpVo bpmFormDesign);

    /**
     * 获取模型业务执行记录
     * @param id
     * @param serviceId
     * @return
     */
    BpmProcessInstanceExt findModelByServiceId(Long id, String serviceId);

    /**
     * 根据流程模型编码、业务id 查询是否已启动历史流程
     * @param bpmKey
     * @param serviceId
     * @return
     */
    BpmProcessInstanceExt findModelByModelKey(String bpmKey, String serviceId);
}
